<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:p="http://primefaces.org/ui">
      

	<h:head><h1>Ricerca/visualizza utenti</h1>
<link type="text/css" href="./generalstyle.css" rel="stylesheet"/>

    <style type="text/css">
        .ui-layout-unit{
             border: none;
        }
    </style>
	
	</h:head>
<body>
	<img src="http://www.agrigentosport.com/wp-content/uploads/2011/09/punto-interrogativo.jpg" alt="" />
       <h:form>
        <p:menubar>  
                <p:menuitem value="Home" url="./home.xhtml" />  
				<p:menuitem value="Area Cliente" url="./cliente/homeCliente.xhtml" />
				<p:menuitem value="Area Impiegato" url="./impiegato/homeImpiegato.xhtml" /> 
				<p:menuitem value="Login" url="./login.xhtml" rendered="#{request.remoteUser == null}" />
                <p:menuitem value="Logout" actionListener="#{logoutManagedBean.logout()}" rendered="#{request.remoteUser != null}" />
		</p:menubar>
		</h:form>
	<h:form>
		<p:outputLabel for="cerca" value="Nome Utente" />
		<p:inputText id="cerca" requiredMessage="Campo obbligatorio"
			value="#{UtenteManagedBean.cerca}" />
		<p:commandButton value="CERCA"
			actionListener="#{UtenteManagedBean.cercaUtenti()}" ajax="false" />
		<p:commandButton value="VISUALIZZA"
			actionListener="#{UtenteManagedBean.visualizzaUtenti()}" ajax="false" />
	</h:form>
	
		
		<ui:repeat value="#{UtenteManagedBean.utenti}" var="utCorr" varStatus="statoUt">
		<h:form>
			<p:layout style=" height:100px;">
				<p:layoutUnit position="center">
					<p:layout style="height:50px;" >
						<p:layoutUnit position="west" size="200">
							<p:outputLabel value="Nome Utente: " />
							<p></p>
							<p:outputLabel value="Email: " />
						</p:layoutUnit>
						<p:layoutUnit position="center">
							<p:outputLabel id="username" value="#{utCorr.username}"
								readonly="true" />
							<p></p>
							<p:outputLabel id="email" value="#{utCorr.email}" readonly="true" />
						</p:layoutUnit>
					</p:layout>
				</p:layoutUnit>
				<p:layoutUnit position="east" size="600">
								<p:commandButton value="WISHLIST"
									actionListener="#{UtenteManagedBean.visualizzaWishlist(UtenteManagedBean.utenti.get(statoUt.index).idWishlist)}"
									ajax="false" />
				</p:layoutUnit>
			</p:layout>
		</h:form>
	</ui:repeat>
	
	
	
</body>
</html>